﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EasySite.Models;
using EasySite.Services;

namespace EasySite.Web.Caches
{
    public class PageCategoryCache
    {
        private List<PageCategory> _pageCategories;
        public List<PageCategory> PageCategories
        {
            get { return _pageCategories; }
        }

        public void Reload()
        {
            var service = DependencyResolver.Current.GetService<IPageCategoryService>();
            _pageCategories = service.GetPageCategories();
        }

        public PageCategoryCache()
        {
            this.Reload();
        }
    }
}